package com.demo2do.fms.entity.supplier.common;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 服务共方基本信息 体系文件
 * 
 * Created by zhonghui on 2017/7/11.
 */
@Alias("StandardDocument")
public enum StandardDocument {

    TYPE_ONE("01", "无"),

    TYPE_TWO("02", "ISO 9000族"),

    TYPE_THREE("03","ISO 14000族"),
    
    TYPE_FOUR("04", "ISO 27000族"),
    
    TYPE_FIVE("05", "ISO 28000族"),
    
    TYPE_SIX("06", "OHSAS 18000族");

    private String code;

    private String description;

    /**
     * @param code
     * @param description
     */
    private StandardDocument(String code , String description) {
        this.code = code;
        this.description = description;
    }
    
    /**
     * @param code
     * @return
     */
    public static StandardDocument codeOf(String code) {
        
        for (StandardDocument document : StandardDocument.values()) {
            if (StringUtils.equals(document.getCode(), code)) {
                return document;
            }
        }
        
        return null;
        
    }
    
    /**
     * 
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * Gets description.
     *
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    
}
